﻿@model MvcApplication2.Controllers.MyMessageListViewModel
@{
    Layout = "~/Views/Shared/_HomeLayout.cshtml";
}
<div class="page-header">
    <h2>
        Messages <small>Find work</small></h2>
</div>
<p>
    @Html.ActionLink("Message", "Index", null, new { @class = "btn btn-mini" })
    @Html.ActionLink("Work", "Index", null, new { @class = "btn btn-mini" })
</p>
<div class="row well">
    <table class="table table-striped table-condensed">
        <tr>
            <th>
                Subject
            </th>
            <th>
                From
            </th>
            <th>
                To
            </th>
            <th>
                Date
            </th>
            <th>
                Type
            </th>
        </tr>
        @foreach (var item in Model.Messagges)
        {
            var cl = string.Empty;
            if(item.IsNew)
            {
                cl = "bolder";
            }
            <tr style="font-weight: @cl ">
                <td>
                    @if(item.IsNew)
                    {
                        <span class="label label-info" >New</span>
                    }
                    @Html.ActionLink(item.Subject,"ReadMessage","User", new { id = item.UserMessageId },null)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.FormattedFrom)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.FormattedTo)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.FormattedDate)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.FormattedType)
                </td>
            </tr>
            } </table>
        </div>
